// app.js
App({
  onLaunch() {
    // 初始化默认设置
    try {
      const settings = wx.getStorageSync('gameSettings')
      if (!settings) {
        wx.setStorageSync('gameSettings', {
          soundEnabled: true,
          vibrationEnabled: true
        })
      }
      
      const gameOptions = wx.getStorageSync('gameOptions')
      if (!gameOptions) {
        wx.setStorageSync('gameOptions', {
          gameTime: 60,
          wordCategory: '普通词汇',
          difficulty: '中等'
        })
      }
    } catch (e) {
      console.error('初始化设置失败', e)
    }
  }
})
